import { createRouter, createWebHistory } from "vue-router";
import NProgress from "nprogress";
import "nprogress/nprogress.css";
import PartManagement from "../views/PartManagement.vue";
import PartInput from "../views/PartInput.vue";
import ProductManagement from "../views/ProductManagement.vue";
import ProductOutput from "../views/ProductOutput.vue";
import ProductBOM from "../views/ProductBOM.vue";

const routes = [
  {
    path: "/",
    name: "partManagement",
    component: PartManagement,
  },
  {
    path: "/partManagement",
    name: "partManagement",
    component: PartManagement,
  },
  {
    path: "/partInput",
    name: "partInput",
    component: PartInput,
  },
  {
    path: "/productManagement",
    name: "productManagement",
    component: ProductManagement,
  },
  {
    path: "/productOutput",
    name: "productOutput",
    component: ProductOutput,
  },
  {
    path: "/productBOM",
    name: "productBOM",
    component: ProductBOM,
  }
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

NProgress.configure({
  easing: "ease", // 动画方式，和css动画属性一样（默认：ease）
  speed: 500, // 递增进度条的速度，单位ms（默认： 200）
});

export default router;
